import pymysql
db = pymysql.connect(
    host="localhost",
    port=3306,
    user="root",
    password="123456",
    db="pet_data",
    charset='utf8'
)
cursor = db.cursor()
SQL = "select * from pet_data"
cursor.execute(SQL)